<%@page import="java.sql.*" %>
<%@page import="java.sql.PreparedStatement" %>
<%@page import="java.sql.ResultSet" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>问题详情界面</title>
<link rel="stylesheet" href='style/item.css'/>
<script>
   onload=function(){ 
        var button=document.getElementById("tk");
        var plcontent=document.getElementById("ptcontent");
        var sq=document.getElementById("sq");
        var fhjg=document.getElementById('fhjg').innerHTML;
        if(fhjg!=""){
            alert(fhjg);
            }
    button.onclick=function(){
            plcontent.removeAttribute('hidden'); 
        }
        sq.onclick=function(){
            plcontent.setAttribute('hidden',"");
        }
    }

  

   
   
</script>
</head>
<body>
<!-----------导入hread.jsp--------------->
<%@include file="hread.jsp" %>
<font color=red  id='fhjg' hidden>${fhjg}</font>
<!-- --------中间 -->

<%  String pname=(String)request.getSession().getAttribute("pname");%>

<c:forEach var="Question" items="${QuestionList}">
<div class=item-content>
   <div class=main>
     <h1>${Question.q_title}</h1>
     <p>${Question.q_content}</p>
     <div class=main-right><h4>总回复数量</h4><p><%=request.getAttribute("count")%></p></div>
    <div class=main-bottom><button onclick="tk()" id=tk>评论</button><span>评论数量:<%=request.getAttribute("count")%></span><span>问题发布时间:</span><span>${Question.post_date}</span></div>
      
    </div>
    
    <!-- -------评论输入框 -->
   <div id='ptcontent' hidden>
     <!-- - -<form action="commentServlet.do?qid=${Question.q_id}&pname=<%=pname %>" method="POST">--->
     <form action="commentServlet.do?qid=${Question.q_id}" method="POST">
      评论内容：<br><textarea class=xwnr name=qcontent rows='14' cols='100' required placeholder="请输入内容"></textarea><br/>
    <input type="submit" value="发表" class=ann> 
    </form> 
     <img src="image/收起.png" width=30px height=30px id=sq>
   </div>
    
</c:forEach>




   
   <!-- ----------评论内容 -->
  <c:forEach var="comment" items="${commentList}"> 
 <div class=one >
    <span>评论用户:</span>&nbsp;<span>${comment.c_user}</span><br>
    <span>评论内容：</span><span>${comment.c_content}</span><br>
    <span>评论时间：</span><span>${comment.c_date}</span>
 </div>

</c:forEach>

</body>
</html>